package com.gskj.eduservice.controller;

import com.gskj.commonutils.ResultJson;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author :CodingFarmer_码农  Connor(康纳)_郭
 * @date : 16:09 20.5.14
 * @Company : http://www.gskj.com
 * @Version : 1.0
 *
 *  登陆检查控制器
 */

@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin// 解决跨域问题
public class EduLoginController {


    /***
     *  模拟用户登陆检查
     * @return
     */
    @RequestMapping("/login")
    public ResultJson userLogin(){

        return ResultJson.success().data("token","admin");
    }

    /***
     *
     * @return
     */
    @RequestMapping("/info")
    public ResultJson userInfo(){

        Map<String,Object> map = new HashMap<>();
        map.put("roles","[admin]");
        map.put("name", "admin");
        map.put("avatar", "http://pic4.zhimg.com/50/v2-db9134864af91d5d5d1aee75b0371a74_hd.jpg");

        return ResultJson.success().data(map);
    }



}
